package top.lishuoboy.hutool.mail;

import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.mail.MailUtil;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class MailUtilTest {

    public static void main(String[] args) throws IOException {

        File projectRoot = new File("").getCanonicalFile();

        File file1 = FileUtil.file(projectRoot, "/tmp/captcha.png");
        File file2 = FileUtil.file(projectRoot, "/tmp/captcha1.png");

        MailUtil.sendText("lishuoboy@163.com", "sendText1", "<h1>邮件来自Hutool测试</h1>", null);
        MailUtil.sendHtml("lishuoboy@163.com", "sendHtml1", "<h1>邮件来自Hutool测试</h1>", null);

        MailUtil.send("lishuoboy@163.com;2513539439@qq.com", "lishuoboy@163.com,2513539439@qq.com", "lishuoboy@163.com,2513539439@qq.com", "send1", "<h1>邮件来自Hutool测试</h1>", true, null);

        List list = new ArrayList<>();
        list.add("lishuoboy@163.com");
        list.add("2513539439@qq.com");

        MailUtil.send(list, list, list, "send2", "<h1>邮件来自Hutool测试</h1>", true, file1, file2);

    }
}
